package L1;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class _077 {
    /**
     * 大笨钟的心情
     */
    public static void main(String[] args) throws IOException {
        Scanner scanner  = new Scanner(System.in);
        Map<Integer,Integer> map = new HashMap<>();
        for (int i=0;i<24;i++){
            map.put(i,scanner.nextInt());
        }
        int temp = scanner.nextInt();
        while (temp>=0&&temp<=23){
            Integer t = map.get(temp);
            if (t>50){
                System.out.println(t+" "+"Yes");
            }else {
                System.out.println(t+" "+"No");
            }
            temp =scanner.nextInt();
        }

    }
}
